]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
background: Handle promise rejection from _loadFile()
authorAlessandro Bono <alessandro.bono369@gmail.com>
Tue, 16 Jun 2026 08:47:10 +0000 (10:47 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 29 Jun 2026 17:48:10 +0000 (19:48 +0200)
This suppresses the following:
```
(gnome-shell:11243): Gjs-WARNING **: 19:15:39.498: Unhandled promise rejection. To suppress
this warning, add an error handler to your promise chain with .catch() or a try-catch block
around your await expression. Stack trace of the failed promise:
_loadFile@resource:///org/gnome/shell/ui/background.js:501:20
_load@resource:///org/gnome/shell/ui/background.js:531:14
_init@resource:///org/gnome/shell/ui/background.js:288:14
Background@resource:///org/gnome/shell/ui/background.js:244:4
getBackground@resource:///org/gnome/shell/ui/background.js:635:30
_createBackgroundActor@resource:///org/gnome/shell/ui/background.js:807:49
_updateBackgroundActor@resource:///org/gnome/shell/ui/background.js:779:39
_createBackgroundActor/changeSignalId<@resource:///org/gnome/shell/ui/background.js:835:18
_emitChangedSignal/this._changedIdleId<@resource:///org/gnome/shell/ui/background.js:321:18
@resource:///org/gnome/shell/ui/init.js:21:20
```

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4253>
(cherry picked from commit 1a9df2b07371116c25bf0751767377df75cbaf6c)

js/ui/background.js

index 09edeb1bec4567a167d2272d4be98c3792fa4b35..aa38f854c989bcc58def99270b59287ea449f110 100644 (file)
@@ -518,7 +518,7 @@ const Background = GObject.registerClass({
             return;
         }
 
-        this._loadFile(this._file);
+        this._loadFile(this._file).catch(logError);
     }
 });